import pandas as pd

for i in range(1, 8):
    old_df = pd.read_csv(f'./merged_output/{i}.csv')
    new_df = pd.read_csv(f'{i}_prediction.csv')

    old_df = old_df[['date', '风速']][-5:]  # 取最后5行
    old_df.rename(columns={'风速': 'wind_speed'}, inplace=True)
    new_df = new_df[['date', 'predicted_wind_speed']]
    new_df.rename(columns={'predicted_wind_speed': 'wind_speed'}, inplace=True)
    new_df = pd.concat([old_df, new_df], axis=0)
    new_df.to_csv(f'./wind_speed/{i}.csv', index=False)
